package com.itheima.mStringTest;

import java.util.Scanner;

/*
      一堆骚操作
 */
public class WorkStringTest03 {
    public static void main(String[] args) {
        //1.键盘录入一个源字符串由字符串变量scrStr
        Scanner sc = new Scanner(System.in);
        String scrStr = sc.nextLine();
        //2.键盘录入一个要删除的字符串变量delStr接收
        String delStr = sc.nextLine();
        int count = 0;
        int a = scrStr.length();
        int b = delStr.length();
        for (int i = 0; i < a - b; i++) {
            String c = scrStr.substring(i, i + b);
            if (c.equals(delStr)) {
                scrStr = scrStr.substring(0, i) + scrStr.substring(i + b);
                count++;
                a -= b;
                i--;
            }
        }
        System.out.println(scrStr);
        System.out.println(count);
    }
}
